import { GlobalClass } from "../../../../com/mui/core/GlobalClass";
import { ImagesConst } from "../../resource/ImagesConst";
import { BaseItem } from "../common/BaseItem";
import { ObjCreate } from "../common/ObjCreate";
import { GTextFormat } from "../../../common/GTextFormat";
import { GlobalStyle } from "../../../common/global/GlobalStyle";
import { ItemData } from "../../resource/info/ItemData";
import { HTMLUtil } from "../../../../com/gengine/utils/HTMLUtil";
import { ColorConfig } from "../../resource/ColorConfig";
import { GLabel } from "../../../../com/mui/controls/GLabel";
//class SmeltProducePanel
    
    export  class SmeltProducePanel /* flash.display.Sprite */
    {
        constructor()
        {
            
            this.createChildren();
            return;
        }

        protected createChildren(): void
        {
            var loc1=null;
            loc1 = GlobalClass.getBitmap(ImagesConst.PackItemBg);
            loc1.x = 47;
            loc1.y = 36;
            this.addChild(loc1);
            this._baseItem = new BaseItem();
            this._baseItem.setSize(32, 32);
            this._baseItem.isDragAble = false;
            this._baseItem.isDropAble = false;
            this._baseItem.isThrowAble = false;
            this._baseItem.isShowLock = false;
            this._baseItem.x = loc1.x + 3;
            this._baseItem.y = loc1.y + 3;
            this.addChild(this._baseItem);
            this._nameLabel = ObjCreate.createLabel("", 120, 8, 200, 20, flash.text.TextFormatAlign.LEFT, this, true, 16711680);
            this._descLabel = ObjCreate.createTextField("", 120, 36, 280, 60, this, new GTextFormat(null, null, GlobalStyle.color1Uint));
            this._descLabel.wordWrap = true;
            return;
        }

        public setMainProduce(arg1: ItemData, arg2: string=""): void
        {
            if (arg1 != null) 
            {
                this._baseItem.itemData = arg1;
                this._nameLabel.htmlText = HTMLUtil.addColor(arg1.itemInfo.item.name, ColorConfig.instance.getItemColor(arg1.itemInfo.item.color).color);
                this._descLabel.htmlText = HTMLUtil.addColor(arg2, GlobalStyle.color1);
            }
            else 
            {
                this._baseItem.itemData = null;
                this._nameLabel.htmlText = "";
                this._descLabel.htmlText = "";
            }
            return;
        }

        /* internal */ /* var */_baseItem: BaseItem;

        /* internal */ /* var */_nameLabel: GLabel;

        /* internal */ /* var */_descLabel: Object /* flash.text.TextField */;
    }
